import request from '@/config/axios'

// 套系 VO
export interface OrderPackageVO {
  id: number // 主键id
  name: string // 套系名称
  status: number // 套系状态
  storeId: number // 门店id
  type: number // 套系类别
}

// 套系 API
export const OrderPackageApi = {
  // 查询套系分页
  getOrderPackagePage: async (params: any) => {
    return await request.get({ url: `/studio/order-package/page`, params })
  },

  // 查询套系详情
  getOrderPackage: async (id: number) => {
    return await request.get({ url: `/studio/order-package/get?id=` + id })
  },

  // 新增套系
  createOrderPackage: async (data: OrderPackageVO) => {
    return await request.post({ url: `/studio/order-package/create`, data })
  },

  // 修改套系
  updateOrderPackage: async (data: OrderPackageVO) => {
    return await request.put({ url: `/studio/order-package/update`, data })
  },

  // 删除套系
  deleteOrderPackage: async (id: number) => {
    return await request.delete({ url: `/studio/order-package/delete?id=` + id })
  },

  // 导出套系 Excel
  exportOrderPackage: async (params) => {
    return await request.download({ url: `/studio/order-package/export-excel`, params })
  },

  // 审核套系
  auditOrderPackage: async (id: number) => {
    return await request.get({ url: `/studio/order-package/audit?id=` + id })
  },
}
